diff options
| author | real-zephex <[email protected]> | 2024-05-29 10:01:52 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-05-29 10:01:52 +0530 |
| commit | 06b2adcd10811b92b079294dbdab65727ff2015b (patch) | |
| tree | 03205287b4f8fa77b251c6b94bac515db04ef314 /src/app/manga/[title] | |
| parent | ✨ feat(series): rewrite series page and drop manga support (diff) | |
| download | dramalama-06b2adcd10811b92b079294dbdab65727ff2015b.tar.xz dramalama-06b2adcd10811b92b079294dbdab65727ff2015b.zip | |
⚡️ perf(deps): upgrade to react 19 and next js 15, add loading screen, drop mangas support
Diffstat (limited to 'src/app/manga/[title]')
| -rw-r--r-- | src/app/manga/[title]/[id]/[read]/download.jsx | 21 | ||||
| -rw-r--r-- | src/app/manga/[title]/[id]/[read]/page.jsx | 54 | ||||
| -rw-r--r-- | src/app/manga/[title]/[id]/[read]/read.module.css | 61 | ||||
| -rw-r--r-- | src/app/manga/[title]/[id]/buttons.jsx | 59 | ||||
| -rw-r--r-- | src/app/manga/[title]/[id]/info.module.css | 220 | ||||
| -rw-r--r-- | src/app/manga/[title]/[id]/page.jsx | 144 | ||||
| -rw-r--r-- | src/app/manga/[title]/page.jsx | 77 | ||||
| -rw-r--r-- | src/app/manga/[title]/title.module.css | 105 |
8 files changed, 0 insertions, 741 deletions
diff --git a/src/app/manga/[title]/[id]/[read]/download.jsx b/src/app/manga/[title]/[id]/[read]/download.jsx deleted file mode 100644 index bddf6d3..0000000 --- a/src/app/manga/[title]/[id]/[read]/download.jsx +++ /dev/null @@ -1,21 +0,0 @@ -"use client";
-
-import styles from "./read.module.css";
-
-export default function DownloadManga({ chapterId: id }) {
- return (
- <div className={styles.DownloadMain}>
- <a
- href={`https://manga-downloader-7nca.onrender.com/download?id=${id}`}
- style={{ textDecoration: "none" }}
- onClick={() =>
- alert(
- "Downloads are not instant. It might take some time to prepare your file. Thank you for your patience"
- )
- }
- >
- <button title="should work just fine">Download - Beta</button>
- </a>
- </div>
- );
-}
diff --git a/src/app/manga/[title]/[id]/[read]/page.jsx b/src/app/manga/[title]/[id]/[read]/page.jsx deleted file mode 100644 index a2b2555..0000000 --- a/src/app/manga/[title]/[id]/[read]/page.jsx +++ /dev/null @@ -1,54 +0,0 @@ -import styles from "./read.module.css";
-import Image from "next/image";
-
-export default async function Read({ params }) {
- const chapterId = params.read;
- const results = await getPages(chapterId);
- const image_base_url = results.baseUrl + "/data/" + results.chapter.hash;
-
- if (results.length === 0) {
- return (
- <div className={styles.NotFound}>
- <p>
- This chapter has no content. Please check the next chapter.
- </p>
- </div>
- );
- }
-
- let images = [];
- for (var i = 0; i < results.chapter.data.length; i++) {
- var imgUrl = image_base_url + "/" + results.chapter.data[i];
- images.push(imgUrl);
- }
-
- return (
- <div className={styles.Main}>
- <div className={styles.ImageContainer}>
- <p>Total pages: {images.length}</p>
- {images &&
- images.map((item, index) => (
- <div className={styles.Image} key={index}>
- <Image
- src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item}&headers=https://mangadex.org`}
- key={index}
- alt="Pages"
- width={800}
- height={1000}
- priority
- quality={100}
- unoptimized
- />
- <p>Page: {index + 1}</p>
- </div>
- ))}
- </div>
- </div>
- );
-}
-
-async function getPages(id) {
- const res = await fetch(`https://api.mangadex.org/at-home/server/${id}`);
- const data = await res.json();
- return data;
-}
diff --git a/src/app/manga/[title]/[id]/[read]/read.module.css b/src/app/manga/[title]/[id]/[read]/read.module.css deleted file mode 100644 index 2c7f964..0000000 --- a/src/app/manga/[title]/[id]/[read]/read.module.css +++ /dev/null @@ -1,61 +0,0 @@ -.Main {
- margin: 65px auto;
-}
-
-.Image {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin: 10px auto;
-}
-
-.Image img {
- height: auto;
- background-color: #272727;
- padding: 5px;
-}
-
-.ImageContainer p {
- text-align: center;
- color: white;
- font-family: "Atkinson Hyperlegible", serif;
- font-size: 16px;
- margin: 5px;
-}
-
-.NotFound {
- text-align: center;
- color: white;
- font-family: "Atkinson Hyperlegible", serif;
- font-size: 20px;
-}
-
-.DownloadMain {
- text-align: center;
-}
-
-.DownloadMain button {
- border: none;
- outline: none;
- border-radius: 5px;
- padding: 5px;
- font-family: "Atkinson Hyperlegible", serif;
- font-size: 16px;
- background-color: var(--light-green);
- cursor: pointer;
-}
-
-.DownloadMain button:hover {
- background-color: var(--pastel-red);
-}
-
-@media screen and (max-width: 768px) {
- .ImageContainer img {
- width: 95%;
- align-items: center;
- }
-
- .Image {
- width: 100%;
- }
-}
diff --git a/src/app/manga/[title]/[id]/buttons.jsx b/src/app/manga/[title]/[id]/buttons.jsx deleted file mode 100644 index 6c419bf..0000000 --- a/src/app/manga/[title]/[id]/buttons.jsx +++ /dev/null @@ -1,59 +0,0 @@ -"use client";
-
-import styles from "./info.module.css";
-import Link from "next/link";
-import { storeLocal } from "../../history/storeData";
-
-export default function Buttons({ content: data }) {
- let hasValidLinks = false;
- function store_to_local(title, chapter, volume, image, id, id2) {
- let data = {
- title: title,
- chapter: chapter,
- volume: volume,
- image: image,
- id: id,
- mangaId: id2,
- };
- storeLocal(data);
- }
-
- return (
- <div className={styles.ChapterContainer}>
- {data.chapters &&
- data.chapters.map((item, index) => {
- if (item.pages !== 0) {
- hasValidLinks = true;
- return (
- <Link
- key={index}
- href={{
- pathname: `/manga/info/read/${item.id}`,
- }}
- onClick={() => {
- store_to_local(
- data.title.english || data.title.romaji,
- parseInt(item.chapterNumber),
- parseInt(item.volumeNumber),
- data.image,
- item.id,
- data.id
- );
- }}
- >
- <button key={index}>
- <div>
- <p>Chapter: {item.chapterNumber}</p>
- <p>Volume: {item.volumeNumber}</p>
- </div>
- </button>
- </Link>
- );
- }
- })}
- {!hasValidLinks && (
- <p className={styles.linksNotFound}>Links not found</p>
- )}
- </div>
- );
-}
diff --git a/src/app/manga/[title]/[id]/info.module.css b/src/app/manga/[title]/[id]/info.module.css deleted file mode 100644 index 0420401..0000000 --- a/src/app/manga/[title]/[id]/info.module.css +++ /dev/null @@ -1,220 +0,0 @@ -.MangaInfoContainer {
- margin: 60px auto;
-}
-
-.MangaHero {
- display: flex;
- flex-direction: column;
- justify-content: center;
-}
-
-.TitleContainer {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 5px;
- background-color: #2c2c2c9c;
- backdrop-filter: blur(5px);
-}
-
-.TitleContainer p {
- font-size: 40px;
- font-weight: 700;
-}
-
-.TitleContainer img {
- border-radius: 10px;
- margin-left: 5px;
-}
-
-.MangaDescription {
- color: white;
- max-width: 98%;
- margin: -10px auto;
-}
-
-.Description h2 {
- color: gray;
-}
-
-.Description p {
- margin-top: -10px;
-}
-
-.MangaReleaseYear {
- margin-top: 10px;
-}
-
-.GenreContainer {
- margin-top: 5px;
- display: flex;
- align-items: center;
-}
-
-.GenreText {
- color: var(--neon-green);
-}
-
-.GenreContainer {
- margin-top: 10px;
-}
-
-.genres {
- display: flex;
- align-items: center;
- overflow-x: auto;
-}
-
-.MangaGenre {
- background-color: #5f5f5f5d;
- border-radius: 5px;
- padding: 2px 5px;
- cursor: pointer;
- margin: 2px;
-}
-
-.MangaRatings {
- display: flex;
- margin-top: 10px;
-}
-
-.MangaRatings span {
- margin-right: 2px;
- margin-left: 2px;
- color: var(--light-green);
-}
-
-.CharactersContainer {
- max-width: 98%;
- margin: 20px auto;
-}
-
-.CharactersContainer h2 {
- color: gray;
-}
-
-.Character {
- display: flex;
- flex-direction: row;
- overflow-x: auto;
- margin-top: -10px;
-}
-
-.Character::-webkit-scrollbar {
- height: 5px;
-}
-
-.Character::-webkit-scrollbar-thumb {
- background-color: #31363f;
- border-radius: 5px;
-}
-
-.CharacterEntry {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: auto;
- margin: 5px;
-}
-
-.CharacterEntry p {
- margin: 10px auto;
- text-align: center;
- width: 110px;
- color: white;
-}
-
-.CharacterEntry img {
- border-radius: 10px;
-}
-
-/* Chapters Buttons */
-
-.Chapters {
- display: flex;
- align-items: center;
- justify-content: space-between;
- max-width: 90%;
- margin: 20px auto;
-}
-
-.ChapterTitle {
- color: white;
- font-size: 32px;
-}
-
-.ChapterContainer {
- width: 50dvw;
- text-align: center;
- height: 300px;
- overflow-y: auto;
-}
-
-.ChapterContainer::-webkit-scrollbar {
- width: 5px;
- height: 0px;
-}
-
-.ChapterContainer::-webkit-scrollbar-thumb {
- background-color: #31363f;
- border-radius: 5px;
-}
-
-.ChapterContainer button {
- width: 130px;
- height: auto;
- padding: 10px;
- margin: 5px;
- border-radius: 5px;
- font-size: 16px;
- border: none;
- outline: none;
- color: white;
- background-color: #3d3d3d;
- cursor: pointer;
- transition: background-color 100ms ease-in-out;
- font-family: "Lexend Deca";
-}
-
-.ChapterContainer button p {
- margin: 2px;
-}
-
-.ChapterContainer button:hover {
- background-color: #1f1f1f;
- transition: background-color 50ms ease-in;
-}
-
-.ChapterContainer button:focus {
- opacity: 0.7;
- transition: transform 0.2s linear;
- background-color: var(--pastel-red);
- transform: scale(0.9);
-}
-
-.linksNotFound {
- color: white;
- font-size: 18px;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 85%;
-}
-
-@media screen and (max-width: 768px) {
- .MangaInfoContainer {
- max-width: 100%;
- }
-
- .TitleContainer p {
- font-size: 28px;
- }
-
- .ChapterContainer button {
- width: 120px;
- }
-
- .ChapterContainer button p {
- font-size: 14px;
- }
-}
diff --git a/src/app/manga/[title]/[id]/page.jsx b/src/app/manga/[title]/[id]/page.jsx deleted file mode 100644 index 37fb3e5..0000000 --- a/src/app/manga/[title]/[id]/page.jsx +++ /dev/null @@ -1,144 +0,0 @@ -import styles from "./info.module.css";
-import Image from "next/image";
-import Buttons from "./buttons";
-import { redirect } from "next/navigation";
-import { FaStar } from "react-icons/fa";
-import { PreFetchChaterLinks } from "../../cacher";
-
-export default async function MangaInfo({ params }) {
- const id = params.id;
- const data = await getMangaInfo(id);
-
- if (data.message) {
- redirect("/404");
- }
-
- let description;
- if (!data.description) {
- description =
- "Sorry but description for this particular manga was not found.";
- } else {
- description = data.description.split("<br>")[0];
- }
-
- PreFetchChaterLinks(data.chapters);
-
- return (
- <div className={styles.MangaInfoContainer}>
- {data && (
- <div className={styles.MangaInfo}>
- <div
- className={styles.MangaHero}
- style={{
- backgroundImage: `url(${data.cover})`,
- backgroundSize: "cover",
- backgroundRepeat: "no-repeat",
- borderRadius: 10,
- }}
- >
- <div className={styles.TitleContainer}>
- <p
- style={{
- color: data.color,
- borderRadius: 10,
- padding: 5,
- }}
- >
- {data.title["english"] || data.title["romaji"]}
- </p>
- <Image
- src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${data.image}`}
- width={200}
- height={310}
- alt="Manga Poster"
- priority
- />
- </div>
- </div>
-
- <div className={styles.MangaDescription}>
- <div className={styles.Description}>
- <h2>Description</h2>
- <p>{description}</p>
- </div>
-
- <div className={styles.MangaReleaseYear}>
- <span style={{ color: "#A3FFD6" }}>
- Started on: {data.startDate["day"]}-
- {data.startDate["month"]}-
- {data.startDate["year"]}
- </span>
- <span style={{ color: "white", margin: 10 }}>
- |
- </span>
- <span style={{ color: "var(--pastel-red)" }}>
- Ended on: {data.endDate["day"]}-
- {data.endDate["month"]}-{data.endDate["year"]}
- </span>
- </div>
-
- <div className={styles.GenreContainer}>
- <span className={styles.GenreText}>Genres: </span>
- <div className={styles.genres}>
- {data.genres &&
- data.genres.map((item, index) => (
- <span
- key={index}
- className={styles.MangaGenre}
- >
- {item}
- </span>
- ))}
- </div>
- </div>
-
- <div className={styles.MangaRatings}>
- <span>Ratings: {data.rating / 10}</span>
- <span>
- <FaStar />
- </span>
- </div>
- </div>
-
- <div className={styles.CharactersContainer}>
- <h2>Characters</h2>
- <div className={styles.Character}>
- {data.characters &&
- data.characters.map((item, index) => (
- <div
- key={index}
- className={styles.CharacterEntry}
- >
- <Image
- src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`}
- width={140}
- height={200}
- alt="Character Poster"
- />
- <p>
- {item.name.full} ({item.role})
- </p>
- </div>
- ))}
- </div>
- </div>
- <div className={styles.Chapters}>
- <p className={styles.ChapterTitle}>
- Chapters & Volumes
- </p>
- <Buttons content={data} />
- </div>
- </div>
- )}
- </div>
- );
-}
-
-async function getMangaInfo(id) {
- const res = await fetch(
- `https://consumet-jade.vercel.app/meta/anilist-manga/info/${id}?provider=mangadex`,
- { next: { revalidate: 21600 } }
- );
- const data = await res.json();
- return data;
-}
diff --git a/src/app/manga/[title]/page.jsx b/src/app/manga/[title]/page.jsx deleted file mode 100644 index 689042b..0000000 --- a/src/app/manga/[title]/page.jsx +++ /dev/null @@ -1,77 +0,0 @@ -import styles from "./title.module.css";
-import Image from "next/image";
-import Link from "next/link";
-import { PreFetchMangaInfo } from "../cacher";
-
-export default async function MangaInfo({ params }) {
- const title = params.title;
- const data = await GetSearchedAnime(title);
-
- PreFetchMangaInfo(data);
-
- return (
- <div className={styles.Main}>
- <div className={styles.MangaContainer}>
- {title && (
- <div className={styles.SearchedFor}>
- <p>Searched for: {decodeURIComponent(title)}</p>
- </div>
- )}
- {data &&
- data.results.map(async (item, index) => {
- let desc = item.description || ""; // Ensure desc is not null
- if (desc === "") {
- desc = "Not found"; // If desc is empty, set it to "Not found"
- }
- return (
- <Link
- href={`./info/${item.id}`}
- style={{ textDecoration: "none" }}
- key={index}
- >
- <div className={styles.MangaEntries}>
- <Image
- src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`}
- width={180}
- height={270}
- alt="Manga Poster"
- />
- <div className={styles.MangaInfo}>
- <p className={styles.MangaTitle}>
- {item.title["english"] ||
- item.title["romaji"]}
- </p>
- <p className={styles.MangaDescription}>
- {desc.includes &&
- desc.includes("<br")
- ? desc.split("<b")[0]
- : desc}
- </p>
- <p className={styles.MangaStatus}>
- Status: {item.status || "not sure"}
- </p>
- <p className={styles.MangaChapters}>
- Chapters:{" "}
- {item.totalChapters || "not sure"}
- </p>
- <p className={styles.MangaVolume}>
- Volumes:{" "}
- {item.volumes || "not sure"}
- </p>
- </div>
- </div>
- </Link>
- );
- })}
- </div>
- </div>
- );
-}
-
-async function GetSearchedAnime(title) {
- const res = await fetch(
- "https://consumet-jade.vercel.app/meta/anilist-manga/" + title
- );
- const data = await res.json();
- return data;
-}
diff --git a/src/app/manga/[title]/title.module.css b/src/app/manga/[title]/title.module.css deleted file mode 100644 index 7ed09bd..0000000 --- a/src/app/manga/[title]/title.module.css +++ /dev/null @@ -1,105 +0,0 @@ -.Main {
- max-width: 95%;
- margin: 60px auto;
-}
-
-.MangaContainer {
- display: flex;
- flex-direction: column;
-}
-
-.SearchedFor {
- color: white;
- text-align: center;
- font-size: 26px;
-}
-
-.MangaEntries {
- display: flex;
- flex-direction: row;
- margin: 0px 10px 10px 10px;
- padding: 10px;
- border-style: solid;
- border-radius: 0.5rem;
- border-color: #363636 #474747;
- border-width: 0.1rem;
- align-items: center;
- cursor: pointer;
- transition: opacity 200ms linear, transform 200ms linear;
-}
-
-/* THIS WORKS*/
-.MangaContainer:hover .MangaEntries {
- opacity: 0.5;
-}
-
-.MangaContainer:hover .MangaEntries:hover {
- opacity: 1;
- transform: scale(1.01);
-}
-
-.MangaInfo {
- color: white;
- margin-left: 20px;
-}
-
-.MangaEntries img {
- border-radius: 0.5rem;
-}
-
-.MangaTitle {
- margin: 0px;
- font-size: 28px;
- color: var(--neon-green);
-}
-
-.MangaDescription {
- margin: 0.5rem 0 0.5rem 0;
-}
-
-.MangaStatus {
- color: var(--soft-purple);
- margin: 0px;
-}
-
-.MangaVolume {
- margin: 0px;
- color: #ffacac;
-}
-
-.MangaChapters {
- color: #ffebb4;
- margin: 0.3rem 0 0.3rem 0;
-}
-
-@media screen and (max-width: 768px) {
- .Main {
- max-width: 100%;
- }
-
- .MangaEntries {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- text-align: center;
- }
-
- .MangaEntries img {
- width: auto;
- height: auto;
- border-radius: 0.3rem;
- background-color: #121212;
- padding: 0.2rem;
- }
-
- .MangaTitle {
- font-weight: 600;
- }
-
- .MangaDescription {
- max-height: 7.5rem;
- overflow: auto;
- }
-
-}
\ No newline at end of file |